import React from 'react';
import { Descriptions, Modal } from 'antd';
import { RobotInfo } from 'admin/schema/Robots';

interface Iprops {
  visible: boolean; // 窗口显示隐藏
  formData: RobotInfo; // 外部数据
  onClose: () => void; // 对话框关闭时的回调
}
/**机器人详情*/
const RobotDetail: React.FC<Iprops> = ({ visible, formData, onClose }) => {
  return (
    <Modal title="机器人详情" visible={visible} onCancel={onClose} footer={null}>
      <Descriptions title={null} column={1} className="robot-flow-detail">
        <Descriptions.Item label="机器人名称">{formData.robotName}</Descriptions.Item>
        <Descriptions.Item label="描述">{formData.robotDescribe}</Descriptions.Item>
        {formData.beforeCallSmsTempName && (
          <Descriptions.Item label="呼前短信">{formData.beforeCallSmsTempName}</Descriptions.Item>
        )}
        {formData.sysAnswerByeTempName && (
          <Descriptions.Item label="呼通挂机短信">
            {formData.sysAnswerByeTempName}
          </Descriptions.Item>
        )}
        {formData.sysNoanswerByeTempName && (
          <Descriptions.Item label="未呼通挂机短信">
            {formData.sysNoanswerByeTempName}
          </Descriptions.Item>
        )}
      </Descriptions>
    </Modal>
  );
};

export default RobotDetail;
